﻿<Window x:Class="Seym.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:s="clr-namespace:System;assembly=mscorlib"
        xmlns:my="clr-namespace:Seym"
        xmlns:myc="clr-namespace:Seym.Kontroller"
        Name="mainWindow"
        Title="{DynamicResource SeymOyunu}" 
        SizeToContent="WidthAndHeight" 
        ResizeMode="NoResize" Icon="/Seym;component/Resimler/Seym.ico">
    <Window.Background>
        <LinearGradientBrush EndPoint="1,0" StartPoint="0,1">
            <GradientStop Color="#FFE5E5E5" Offset="0" />
            <GradientStop Color="#FFCBCBCB" Offset="0.5" />
            <GradientStop Color="#FFE5E5E5" Offset="1" />
        </LinearGradientBrush>
    </Window.Background>
    <Window.CommandBindings>
        <CommandBinding Command="Undo" Executed="UndoCommand_Executed" />
        <CommandBinding Command="New" Executed="NewGameCommand_Executed" />
        <CommandBinding Command="Properties" Executed="PropertiesCommand_Executed" />
    </Window.CommandBindings>
    <Window.Resources>
        <Storyboard x:Key="Vurgu" RepeatBehavior="Forever">
            <DoubleAnimationUsingKeyFrames BeginTime="0:0:0" Storyboard.TargetName="YeniOyun" Storyboard.TargetProperty="(UIElement.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)">
                <SplineDoubleKeyFrame Value="15" KeyTime="0:0:0.5" KeySpline="0.5,0,1,0.5" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="0:0:0.5" Storyboard.TargetName="YeniOyun" Storyboard.TargetProperty="(UIElement.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)">
                <SplineDoubleKeyFrame Value="0" KeyTime="0:0:0.5" KeySpline="0,0.5,0.5,1" />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </Window.Resources>
    <Grid Name="Wrapper">
        <Grid.RowDefinitions>
            <RowDefinition Height="35" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="30" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <!-- Üst kontroller -->
        <StackPanel Orientation="Horizontal" Margin="12,0,0,0" Height="24" HorizontalAlignment="Left" VerticalAlignment="Bottom">
            <Button Content="{DynamicResource YeniOyun}" Margin="0,0,5,0" x:Name="YeniOyun" Command="New" Padding="8,0,8,1">
                <Button.BitmapEffect>
                    <OuterGlowBitmapEffect GlowColor="#FFFF9900" GlowSize="0" />
                </Button.BitmapEffect>
            </Button>
            <Button Content="{DynamicResource Siralamalar}" Margin="5,0" Name="Siralamalar" Click="Siralamalar_Click" Padding="8,0,8,1" />
            <Button Content="{DynamicResource Secenekler}" Margin="5,0" Name="Secenekler" Command="Properties" Padding="8,0,8,1" />
        </StackPanel>
        <StackPanel Orientation="Horizontal" Margin="0,0,12,0" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="24" FlowDirection="RightToLeft" Grid.Column="1" Name="BoyutDegistirPanel">
            <ToggleButton my:ToggleButtonExtensions.GroupName="Boyut" Width="24" Margin="0,0,3,0" Click="BoyutDegistir_Click" ToolTip="{DynamicResource Büyük}">
                <Image Source="/Seym;component/Resimler/large.png" />
            </ToggleButton>
            <ToggleButton my:ToggleButtonExtensions.GroupName="Boyut" Width="24" Margin="3,0" Click="BoyutDegistir_Click" ToolTip="{DynamicResource Orta}">
                <Image Source="/Seym;component/Resimler/medium.png" />
            </ToggleButton>
            <ToggleButton my:ToggleButtonExtensions.GroupName="Boyut" Width="24" Margin="3,0" Click="BoyutDegistir_Click" ToolTip="{DynamicResource Küçük}">
                <Image Source="/Seym;component/Resimler/small.png" />
            </ToggleButton>
        </StackPanel>
        <!--/ Üst kontroller-->
        <myc:KutuYigini x:Name="KutuTutucu" 
                       Grid.Row="1" 
                       PuanGostergeci="True" 
                       Grid.ColumnSpan="2" 
                       Margin="12,10,12,8" 
                       SecimDegisti="KutuTutucu_SecimDegisti" 
                       KutuSilindi="KutuTutucu_KutuSilindi"
                       Background="#77FFFFFF" />
        <!-- Alt kontroller -->
        <Grid Grid.Row="2" Background="#99000000">
            <TextBlock Margin="12,0,0,0" VerticalAlignment="Center" FontSize="16">
                <Run Text="{DynamicResource Puan_Etiket}" Foreground="#FF000000" />
                <Run Text="0" Name="ToplamPuan" FontFamily="Georgia" Foreground="#FFFFFFFF" />
                <Run Text="" Name="SeciliPuan" FontFamily="Georgia" Foreground="#FFFFDD00" />
                <Run Text="" Name="SeciliKutu" FontSize="12" Foreground="#FFFF9900" />
            </TextBlock>
        </Grid>
        <StackPanel Background="#99000000" Orientation="Horizontal" FlowDirection="RightToLeft" Grid.Row="2" Grid.Column="1" Name="AltBilgi" />
        <!--/ Alt kontroller -->
        <!-- AdSorPopup -->
        <Popup Placement="Center" Width="270" Name="AdSorPopup">
            <Border Background="White" BorderThickness="1" BorderBrush="#FF666666">
                <StackPanel>
                    <TextBlock Margin="8">
                        <Run Text="{DynamicResource OyunBitti_Yazi}" FontSize="16" />
                        <LineBreak />
                        <LineBreak />
                        <Run Text="{DynamicResource IsimYaz_Etiket}" />
                    </TextBlock>
                    <TextBox Margin="8,0" FontSize="18" Height="30" KeyUp="OyuncuAdi_KeyUp" Name="OyuncuAdi" />
                    <Button HorizontalAlignment="Right" Margin="8" Content="{DynamicResource Devam}" Padding="8,0,8,1" Name="PuanKaydet" Click="PuanKaydet_Click" />
                </StackPanel>
            </Border>
        </Popup>
        <!--/ AdSorPopup -->
        <!-- SiralamaPopup -->
        <Popup Placement="Center" Width="300" MinHeight="300" Name="SiralamalarPopup">
            <Border Background="White" BorderThickness="1" BorderBrush="#FF666666">
                <Grid Margin="2">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="25" />
                        <RowDefinition />
                        <RowDefinition Height="40" />
                    </Grid.RowDefinitions>
                    <TextBlock HorizontalAlignment="Left" Margin="8" Text="{DynamicResource Siralamalar}" VerticalAlignment="Center" FontFamily="Lucida Sans Unicode" FontSize="18" Foreground="#FFFF0033" />
                    <ComboBox Height="23" HorizontalAlignment="Right" Margin="8" Name="Buyukluk" VerticalAlignment="Center" Width="70" SelectionChanged="Kriterler_SelectionChanged" />
                    <ComboBox Height="23" HorizontalAlignment="Right" Margin="8,8,86,8" Name="Kriter" VerticalAlignment="Center" Width="80" SelectionChanged="Kriterler_SelectionChanged">
                        <ComboBoxItem Content="{DynamicResource Puan}" IsSelected="True" />
                        <ComboBoxItem Content="{DynamicResource Kombo}" />
                        <ComboBoxItem Content="{DynamicResource KalanKutu}" />
                    </ComboBox>
                    <Grid Grid.Row="1" Width="278">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="15" />
                            <ColumnDefinition Width="5*" />
                            <ColumnDefinition Width="3*" />
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="1" Text="{DynamicResource Ad}" FontFamily="Trebuchet MS" Margin="3" FontSize="14" VerticalAlignment="Center" Foreground="#FF0066FF" />
                        <TextBlock Grid.Column="2" Name="SiralamaKriteriBaslik" FontFamily="Trebuchet MS" VerticalAlignment="Center" Margin="3" FontSize="14" Foreground="#FF0066FF" />
                    </Grid>
                    <ListBox Grid.Row="2" Name="SiralamaListesi" BorderThickness="0">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Grid Height="25" Width="278">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="20" />
                                        <ColumnDefinition Width="5*" />
                                        <ColumnDefinition Width="3*" />
                                    </Grid.ColumnDefinitions>
                                    <TextBlock Grid.Column="0" Text="{Binding Path=Sira, Mode=OneWay}" FontSize="15" Background="#FF666666" Foreground="#FFFFFFFF" TextAlignment="Center" FontFamily="Comic Sans MS" VerticalAlignment="Center" />
                                    <TextBlock Grid.Column="1" Text="{Binding Path=Ad, Mode=OneWay}" FontSize="12" FontFamily="Trebuchet MS" Margin="5,3" VerticalAlignment="Center" />
                                    <TextBlock Grid.Column="2" Text="{Binding Path=Deger, Mode=OneWay}" Margin="3" FontFamily="Georgia" VerticalAlignment="Center" FontSize="14" />
                                </Grid>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Stretch" Width="Auto">
                        <Button Padding="8,0,8,1" Height="27" HorizontalAlignment="Right" Margin="8,5" Foreground="#FFFF0066" Content="{DynamicResource Kapat}" Click="SiralamaPopupKapat_Click" />
                        <Button Padding="8,0,8,1" Height="27" HorizontalAlignment="Right" Margin="8,5" Content="{DynamicResource Temizle}" Click="SiralamaTemizle_Click" />
                        <TextBlock Margin="10,5" FontSize="12" VerticalAlignment="Center">
                            <Run FontWeight="Bold" Name="RenkSayisiGoster" />
                            <Run Text="{DynamicResource RenkSayisiGoster_Yazi}" />
                        </TextBlock>
                    </StackPanel>
                </Grid>
            </Border>
        </Popup>
        <!--/ SiralamaPopup -->
        <!-- SeceneklerPopup -->
        <Popup Placement="Center" Width="300" MinHeight="300" Name="SeceneklerPopup">
            <Border Background="White" BorderThickness="1" BorderBrush="#FF666666">
                <Grid Margin="2">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="1*" />
                        <RowDefinition Height="1*" />
                        <RowDefinition Height="1*" />
                        <RowDefinition Height="2*" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="2*" />
                        <ColumnDefinition Width="3*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock HorizontalAlignment="Left" Margin="8" Text="{DynamicResource Secenekler}" VerticalAlignment="Center" FontFamily="Lucida Sans Unicode" FontSize="18" Foreground="#FFFF0033" />
                    <TextBlock Grid.Row="1" Grid.Column="0" Margin="12,0" VerticalAlignment="Center" TextWrapping="WrapWithOverflow" HorizontalAlignment="Left" FontSize="12" Text="{DynamicResource RenkSayisi}" />
                    <ComboBox Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" Width="50" HorizontalAlignment="Left" FontSize="12" Name="RenkSayisiSec">
                        <s:Byte>3</s:Byte>
                        <s:Byte>4</s:Byte>
                        <s:Byte>5</s:Byte>
                        <s:Byte>6</s:Byte>
                        <s:Byte>7</s:Byte>
                    </ComboBox>
                    <TextBlock Grid.Row="2" Grid.Column="0" Margin="12,0" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="12" Text="{DynamicResource KutucukStili}" />
                    <ComboBox Grid.Row="2" Grid.Column="1" VerticalAlignment="Center" Width="150" HorizontalAlignment="Left" FontSize="12" Name="TemaSec">
                        <s:String>varsayilan</s:String>
                        <s:String>gradient</s:String>
                        <s:String>harfler</s:String>
                        <s:String>sayilar</s:String>
                    </ComboBox>
                    <TextBlock Grid.Row="3" Grid.Column="0" Margin="12,0" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="12" TextWrapping="WrapWithOverflow" Text="{DynamicResource CesitliSecenekler}" />
                    <StackPanel Grid.Row="3" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" >
                        <CheckBox Name="GeriAlmaCezasi" Content="{DynamicResource GeriAlmaCezasi}" Margin="0,4,8,4" />
                    </StackPanel>
                    <TextBlock Grid.Row="4" Grid.Column="0" Margin="12,0" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="12" Text="{DynamicResource OyunDili}" />
                    <ComboBox Grid.Row="4" Grid.Column="1" VerticalAlignment="Center" Width="150" HorizontalAlignment="Left" FontSize="12" Name="DilSec">
                        <s:String>Türkçe</s:String>
                        <s:String>English</s:String>
                    </ComboBox>
                    <StackPanel Grid.Row="5" Grid.ColumnSpan="2" Margin="0,8" Orientation="Horizontal" HorizontalAlignment="Stretch" Background="Azure">
                        <Button Content="{DynamicResource Kapat}" Click="Vazgec_Click" HorizontalAlignment="Right" Foreground="#FFFF0066" Margin="8,5" Height="27" Padding="8,0,8,1" />
                        <Button Content="{DynamicResource Uygula}" Click="Uygula_Click" HorizontalAlignment="Right" Margin="8,5" Height="27" Padding="8,0,8,1" />
                    </StackPanel>
                </Grid>
            </Border>
        </Popup>
        <!--/ SeceneklerPopup -->
        <Grid Grid.RowSpan="3" Grid.ColumnSpan="2" Background="#44000000" Panel.ZIndex="1" Name="Overlay" Visibility="Hidden">
            <TextBlock HorizontalAlignment="Right" Padding="10" Background="#DD000000" VerticalAlignment="Bottom" Foreground="White">
                <Run Text="{DynamicResource Hazirlayan_Etiket}"></Run>
                <Hyperlink NavigateUri="http://www.sinanyil.com" Click="Hyperlink_Click" Foreground="#FF0066FF" ToolTip="http://www.sinanyil.com">Sinan Yıl</Hyperlink>
            </TextBlock>
        </Grid>
    </Grid>
</Window>
